<template>
  <div>
    <el-dialog :title="name+'，'+cardid+'参与的项目记录'" size="large" :visible.sync="projectDialogVisible" :before-close="closeDialog"
               :close-on-click-modal="false" v-on:open="loadData">
      <el-table stripe
                element-loading-text="数据加载中"
                :data="list"
                style="width:100%"
                height="450"
                border>
        <el-table-column
          inline-template
          label="序号"
          width="80px"
          >
          <span>{{$index + 1}}</span>
        </el-table-column>
        <el-table-column
          label="通过日期"
          width="120px"
          inline-template
          >
          <template>
            {{row.passTime?row.passTime.substring(0,10):''}}
          </template>
        </el-table-column>
        <el-table-column
          label="项目名称"
          property="projectName"
          width="200px"
          >
        </el-table-column>
        <el-table-column
          label="中心名称"
          property="siteName"
          width="200px"
          >
        </el-table-column>
        <el-table-column
          label="中心所在城市"
          property="city"
          width="200px"
          >
        </el-table-column>
        <el-table-column
          label="筛选结果"
          width="120px"
          inline-template
          >
          <template>
            <span :class="{'red':row.candidateResult==2,'green':row.candidateResult==1}">{{candidateResult[row.candidateResult]}}</span>
          </template>
        </el-table-column>
        <el-table-column
          label="失败原因"
          property="nopassRemark"
          width="200px"
          >
        </el-table-column>
        <el-table-column
          label="试验状态"
          inline-template
          width="100px"
        >
          <template>
            {{statusList[row.projectStatus]}}
          </template>
        </el-table-column>
        <el-table-column
          label="依从性评分"
          property="complianceScore"
          width="200px"
          >
        </el-table-column>
        <el-table-column
          label="试验人员评价"
          property="evaluate"
          width="200px"
          >
        </el-table-column>
      </el-table>
      <div style="float: right;padding:10px 0px ;">
        <el-button @click.native="closeDialog">关闭</el-button>
      </div>
    </el-dialog>
  </div>
</template>
<script>
  import http from '../../../api/http'
  export default {
    data() {
      return {
        statusList: ['设计中','试验中','已停止','-'],
        list:[],
        candidateResult:['-','成功','失败']
      }
    },
    props: {
      projectDialogVisible: {
        type: Boolean,
        default: false
      },
      cardid:{type: String},
      name: {type: String}
    },
    computed: {

    },
    methods: {
      loadData(){
        var vm = this;
        http.postData(vm, '/pt/subjects/poolDetail/' + vm.cardid, {}, function (resp) {
          var ret = resp.body;
          if (ret.code == 111) {
            vm.list = ret.value;
          }
        });
      },
      closeDialog(){
        this.$parent.closeProjectListDialog();
      }
    },
    created() {
    },
  }
</script>
<style>
</style>
